﻿@{
    Layout = "~/Views/Shared/_LayoutMobile.cshtml";
    ViewBag.Title = "登录";
}
@section Header{
    <script>
        Zepto(function ($) {
            $('#btn-login').click(function () {
                if (!$('#txtUserName').val()) {
                    $('#txtUserName').focus();
                    utils.ui.showPopMsg('请输入用户名');
                    return false;
                }
                if (!$('#txtUserPassword').val()) {
                    $('#txtUserPassword').focus();
                    utils.ui.showPopMsg('请输入密码');
                    return false;
                }
                if (!$('#txtUservCode').val()) {
                    $('#txtUservCode').focus();
                    utils.ui.showPopMsg('请输入验证码');
                    return false;
                }

                return true;
            });
            $('#img-vcode').click(function () {
                $(this).attr('src', '@Url.Action("vvcodeImg","Auth")?date=' + new Date());
            });
            $('.pwd-toggle').click(function () {
                var $prev = $(this).prev();
                if ($(this).hasClass('active')) {
                    $(this).removeClass('active');
                    $prev.attr('type', 'password');
                } else {
                    $(this).addClass('active');
                    $prev.attr('type', 'text');
                }
            });

            var msg = '@ViewBag.ErrorMessage';
            if (msg) {
                utils.ui.showPopMsg(msg);
            }

        });
</script>
}
        <form id="ff" action="?action=submit&redirect=@HttpUtility.UrlEncode(Request["redirect"])&state=@Request["state"]" method="post">
            <input type="hidden" name="isLoginAnyway" value="1"/>
    	    <div class="m-login">
        	    <div class="login-bd"><img src="@Url.Content("~/Content/Login/ebulletin_mobile/images/login-logo.png")" /></div>
        	    <ul>
            	    <li>
                	    <input type="text" name="txtUserName" id="txtUserName" placeholder="@Html._T("输入手机号/用户名/邮箱")" value="@ViewBag.UserName"/>
                        <a href="javascript:;" class="text-clear" onclick="$('#txtUserName').val('');"></a>
                    </li>
                    <li>
                	    <input type="password" name="txtUserPassword" id="txtUserPassword" placeholder="@Html._T("输入密码")" value="@ViewBag.UserPassword" />
                        <a href="javascript:;" class="pwd-toggle"></a>
                    </li>
                    <li>
                	    <input type="text" name="vCode" id="txtUservCode" placeholder="@Html._T("输入验证码")" />
                        <img class="yzm" src="@Url.Action("vvcodeImg", "Auth")" id="img-vcode"/>
                    </li>
                </ul>
                <div class="submit-btns">
            	    <button type="submit" id="btn-login" class="btn-danger">@Html._T("登录")</button>
                    <div class="other-link f-cb">
                        <p class="f-fl"><a href="@Url.Action("forgot", "register")?redirect=@HttpUtility.UrlEncode(Request["redirect"])&state=@Request["state"]">@Html._T("忘记密码？")</a></p>

                        <p class="f-fr"><a class="f-c-red" href="@Url.Action("index", "register")?redirect=@HttpUtility.UrlEncode(Request["redirect"])&state=@Request["state"]">@Html._T("注册")</a></p>
                    </div>
                </div>
            </div>
        </form>